package lock;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicStampedReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class MainTest {

    public static void main(String[] args) {
        Long start = System.currentTimeMillis();
        int i = 1000000000;
        Lock lock = new ReentrantLock();
//        AtomicInteger atomicInteger = new AtomicInteger(i);
        for (int i1 = 0; i1 < 500000000; i1++) {
            lock.lock();
//            atomicInteger.addAndGet(i);
            i++;
            lock.unlock();
        }
//        System.out.println(atomicInteger.get());
        System.out.println(i);
        System.out.println(System.currentTimeMillis() - start);
    }

}
